package com.maxatime.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.maxatime.dao.ExamPlanSubjectRelationMapper;
import com.maxatime.dao.ExamSubjectMapper;
import com.maxatime.pojo.entity.Exam;
import com.maxatime.pojo.entity.ExamPlanSubjectRelation;
import com.maxatime.pojo.entity.ExamSubject;
import com.maxatime.service.ExamPlanSubjectRelationService;

@Service
public class ExamPlanSubjectRelationImpl implements ExamPlanSubjectRelationService{

	@Autowired
	ExamPlanSubjectRelationMapper examPlanSubjectRelationMapper;
	
	@Autowired
	ExamSubjectMapper examSubjectMapper;
	@Override
	public List<Exam> list(int examPlanId) {
		// TODO Auto-generated method stub
		List<Exam> list = examPlanSubjectRelationMapper.list(examPlanId);
		return list;
	}
	@Override
	public int deleteByPrimaryKey(Integer pkId) {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public int insert(ExamPlanSubjectRelation record) {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public int insertSelective(ExamPlanSubjectRelation record) {
		// TODO Auto-generated method stub
		ExamPlanSubjectRelation examPlanSubjectRelation = new ExamPlanSubjectRelation();
		BeanUtils.copyProperties(record, examPlanSubjectRelation);
		examPlanSubjectRelation.setDeleteFlag("0");
		Date d = new Date();
		examPlanSubjectRelation.setCreateDate(d);
		examPlanSubjectRelation.setUpdateDate(d);
		examPlanSubjectRelationMapper.insertSelective(examPlanSubjectRelation);
		return 0;
	}
	@Override
	public ExamPlanSubjectRelation selectByPrimaryKey(Integer pkId) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public int updateByPrimaryKeySelective(ExamPlanSubjectRelation record) {
		// TODO Auto-generated method stub
		return 0;
	}
	@Override
	public int updateByPrimaryKey(ExamPlanSubjectRelation record) {
		// TODO Auto-generated method stub
		return 0;
	}
	//详情新增查询下拉框
	@Override
	public List<ExamSubject> list(ExamSubject examSubject) {
		// TODO Auto-generated method stub
		return examSubjectMapper.list2(examSubject);
	}

}
